/* GUI CONVERTED from rcctmtb.p (converter v1.75) Tue Apr 10 12:03:37 2001 */
/* rcctmtb.p - Release Management Customer Schedules                          */
/* Copyright 1986-2002 QAD Inc., Carpinteria, CA, USA.                        */
/* All rights reserved worldwide.  This is an unpublished work.               */
/* $Revision: 1.6.1.3 $                                                          */
/*V8:ConvertMode=Maintenance                                                  */
/* REVISION: 7.3    LAST MODIFIED: 08/13/93        BY: WUG *GE19*             */
/* REVISION: 7.5    LAST MODIFIED: 11/21/94        BY: taf *J038*             */
/* REVISION: 7.3    LAST MODIFIED: 04/11/95        BY: ame *F0QB*             */
/* REVISION: 8.5    LAST MODIFIED: 12/13/97        BY: *J20Q* Aruna Patil     */
/* REVISION: 8.6    LAST MODIFIED: 05/20/98        BY: *K1Q4* Alfred Tan      */
/* REVISION: 8.6    LAST MODIFIED: 08/18/99        BY: *K223* Santosh Rao     */
/* REVISION: 9.1    LAST MODIFIED: 08/12/00        BY: *N0KP* Mark Brown      */
/* Old ECO marker removed, but no ECO header exists *F0PN*                    */
/* $Revision: 1.6.1.3 $    BY: Jean Miller    DATE: 03/22/01 ECO: *P008*         */
/******************************************************************************/
/* All patch markers and commented out code have been removed from the source */
/* code below. For all future modifications to this file, any code which is   */
/* no longer required should be deleted and no in-line patch markers should   */
/* be added.  The ECO marker should only be included in the Revision History. */
/******************************************************************************/

/* CONTAINER MAINT SUBPROGRAM */
/* SWITCH DB'S IF NECESSARY TO EDIT REMOTE DB INVENTORY ISSUE */

{mfdeclre.i}

define input parameter transtype like tr_type.
define input parameter shipfrom_site as character.
define input parameter site like tr_site.
define input parameter location like tr_loc.
define input parameter part like tr_part.
define input parameter lotserial like tr_serial.
define input parameter lotref like tr_ref.
define input parameter quantity like tr_qty_loc.
define input parameter um like tr_um.
define input parameter um_conv like sod_um_conv no-undo.
define output parameter undotran like mfc_logical no-undo.

define variable old_db as character.
define variable sdb_err as integer no-undo.
define variable conv like sod_um_conv no-undo.

conv = 1.
find pt_mstr where pt_part = part no-lock no-error.

if available pt_mstr
   and um_conv = 0
then do:

   {gprun.i ""gpumcnv.p""
      "(input um,
        input pt_um,
        input pt_part,
        output conv)" }
/*GUI*/ if global-beam-me-up then undo, leave.


   if conv = ? then conv = 1.

end. /* IF AVAILABLE pt_mstr */
else
   conv = um_conv.

find si_mstr where si_site = shipfrom_site no-lock.

if si_db <> global_db then do:

   old_db = global_db.

   {gprun.i ""gpalias3.p""
      "(input si_db, output sdb_err)"}
/*GUI*/ if global-beam-me-up then undo, leave.


   /* MODIFIED 7TH PARAMETER QUANTITY TO QUANTITY * CONV */
   {gprun.i ""icedit.p""
      "(input transtype,
        input site,
        input location,
        input part,
        input lotserial,
        input lotref,
        input quantity * conv,
        input um,
        input """",
        input """",
        output undotran)"}
/*GUI*/ if global-beam-me-up then undo, leave.


   {gprun.i ""gpalias3.p""
      "(input old_db, output sdb_err)"}
/*GUI*/ if global-beam-me-up then undo, leave.


end.
else do:

   /* MODIFIED 7TH PARAMETER QUANTITY TO QUANTITY * CONV */
   {gprun.i ""icedit.p""
      "(input transtype,
        input site,
        input location,
        input part,
        input lotserial,
        input lotref,
        input quantity * conv,
        input um,
        """",
        """",
        output undotran)"}
/*GUI*/ if global-beam-me-up then undo, leave.

end.
